<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html >
<html>
<head>
<title>案件修改</title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>

<style type="text/css">
.Validform_label_OR {
	font-size: 12px;
	color: #5E7595;
	white-space: nowrap;
}
</style>

<script>
	var elmentId = "";
	function openDepartmentSelect(id) {
		$.dialog.setting.zIndex = getzIndex(true);
		elmentId = id;
		var orgIds = $("#" + id).val();

		$.dialog({
			content : 'url:departController.do?departSelect&orgIds=' + orgIds,
			zIndex : 2100,
			title : '组织机构列表',
			lock : true,
			width : '400px',
			height : '350px',
			opacity : 0.4,
			button : [ {
				name : '<t:mutiLang langKey="common.confirm"/>',
				callback : callbackDepartmentSelect,
				focus : true
			}, {
				name : '<t:mutiLang langKey="common.cancel"/>',
				callback : function() {
				}
			} ]
		}).zindex();
	}

	function callbackDepartmentSelect() {
		var iframe = this.iframe.contentWindow;
		var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
		var nodes = treeObj.getCheckedNodes(true);
		if (nodes.length > 0) {
			var ids = '', names = '';
			for (i = 0; i < nodes.length; i++) {
				var node = nodes[i];
				ids += node.id + ',';
				names += node.name + ',';
			}
			$('#name' + elmentId).val(names);
			$('#name' + elmentId).blur();
			$('#' + elmentId).val(ids);
		}
	}

	$(function() {
		$("#caseStatus").val("${surveyInfo.caseStatus}");
		$("#accidentType").val("${surveyInfo.accidentType}");
		$("#ifCase").val("${surveyInfo.ifCase}");
		$("#guideWay").val("${surveyInfo.guideWay}");
		$("#accidentAfter").val("${surveyInfo.accidentAfter}");

	});

	function checkForm() {
		if ("是" == $("#ifCase").val()) {
			if ("" == $("#remark").val() || null == $("#remark").val()) {
				alert("请填写备注！");
				return false;
			}
		}
		return true;
	}

	function changeAccd(num) {
		if(num<2){
			var accdVal = $("#accidentLiability" + num).val();
			for (var i = 0; i < 2; i++) {
				if ("全责" == accdVal) {
					if (num != i) {
						$("#accidentLiability" + i).val("无责");
					}
				} else if ("无责" == accdVal) {
					if (num != i) {
						$("#accidentLiability" + i).val("全责");
					}
				} else if ("同责" == accdVal) {
					if (num != i) {
						$("#accidentLiability" + i).val("同责");
					}
				}else if ("主责" == accdVal) {
					if (num != i) {
						$("#accidentLiability" + i).val("次责");
					}
				}else if ("次责" == accdVal) {
					if (num != i) {
						$("#accidentLiability" + i).val("主责");
					}
				}
				
			}
		}
	}
	function askChange(){
		var ask=$("#ask").val();
		if(ask=='否'){
			$("#askType").val("");
			$("#askRrk").val("");
		}
	}
</script>
</head>

<body style="overflow: hidden; width: 100%;" scroll="no">
	<t:formvalid formid="formobj" dialog="true" usePlugin="password"
		layout="table" action="surveyInfoController.do?doUpdateCase"
		beforeSubmit="checkForm()">
		<input id="id" name="id" type="hidden" value="${surveyInfo.id }">
		<div
			style="position: absolute; height: 100%; overflow: auto; width: 100%;">
			<div style="color: red;">
				<strong>案件信息</strong>
			</div>
			<table cellpadding="0" cellspacing="1" class="formtable"
				style="width: 100%;">
				<tr>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="案件流水号" />:
					</label></td>
					<td class="value" width="30%">${surveyInfo.reportNo}<input
						type="hidden" id="reportNo" name="reportNo"
						value="${surveyInfo.reportNo}"> <input type="hidden"
						id="workSpace" name="workSpace" value="${surveyInfo.workSpace}">
					</td>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="案件状态" />:
					</label></td>
					<td class="value" width="30%"><c:if
							test="${surveyInfo.caseStatus == 'F'}">已完成</c:if> <c:if
							test="${surveyInfo.caseStatus == 'C'}">注销</c:if> <c:if
							test="${surveyInfo.caseStatus == 'S'}">已提交</c:if> <c:if
							test="${surveyInfo.caseStatus == 'T'}">未提交</c:if> <input
						type="hidden" id="caseStatus" name="caseStatus"
						value="${surveyInfo.caseStatus}" /></td>
				</tr>
				<tr>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="操作人员" />:
					</label></td>
					<td class="value" width="30%">
						<%-- ${surveyInfo.appUser.dptName} --%> <input
						id="appUser.dptName" class="inputxt" name="appUser.dptName"
						value="${surveyInfo.appUser.empName}">
					</td>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="人员工号" />:
					</label></td>
					<td class="value" width="30%"><input id="appUser.empCde"
						class="inputxt" name="appUser.empCde"
						value="${surveyInfo.appUser.empCde}"></td>
				</tr>
				<tr>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="事故类型" />:
					</label></td>
					<td class="value" width="30%"><select id="accidentType"
						width="100" name="accidentType" style="width: 104px"
						value="${surveyInfo.accidentType}">
							<option value="单方事故">单方事故</option>
							<option value="双方事故">双方事故</option>
							<option value="多方事故">多方事故</option>
					</select></td>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="出险时间" />:
					</label></td>
					<td class="value" width="30%">
					<input type="text" name="dangerTime" value="${surveyInfo.dangerTime}"  style="width: 150px"   class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" />			
					</td>
				</tr>
				<tr>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="出险地点" />:
					</label></td>
					<td class="value" width="30%"><input id="dangerPlace"
						class="inputxt" name="dangerPlace"
						value="${surveyInfo.dangerPlace}"></td>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="所属交警大队" />:
					</label></td>
					<td class="value" width="30%"><input id="trafficPolice"
						class="inputxt" name="trafficPolice"
						value="${surveyInfo.trafficPolice}"></td>
				</tr>
				<tr>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="是否关联案件" />:
					</label></td>
					<td class="value" width="30%"><select id="ifCase" width="100"
						name="ifCase" value="${surveyInfo.ifCase}">
							<option value="是">是</option>
							<option value="否">否</option>
					</select></td>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="所属地市" />:
					</label></td>
					<td class="value" width="30%"><input id="city" class="inputxt"
						name="city" value="${surveyInfo.city}"></td>
				</tr>
				<tr>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="指引方式" />:
					</label></td>
					<td class="value" width="30%"><select id="guideWay"
						width="100" name="guideWay" style="width: 104px"
						value="${surveyInfo.guideWay}">
							<option value="交警和保险公司都指引">交警和保险公司都指引</option>
							<option value="交警指引">交警指引</option>
							<option value="保险公司指引">保险公司指引</option>
							<option value="当事人自行前往">当事人自行前往</option>
					</select></td>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="事故经过" />:
					</label></td>
					<td class="value" width="30%"><t:dictSelect id="accident"
							hasLabel="false" field="accidentAfter" typeGroupCode="accident"
							defaultVal="${surveyInfo.accidentAfter}"></t:dictSelect> <%-- <select id="accidentAfter" name="accidentAfter" width="100"  style="width: 104px" value="${surveyInfo.accidentAfter}"> 
						<option value="1">追尾</option>
				        <option value="2">变更车道或越线行驶</option>
				        <option value="3">倒车或溜后</option>
				        <option value="4">未按照交通信号指示通行</option>
				        <option value="5">转弯车未让直行车先行</option>
				        <option value="6">逆向行驶</option>
				        <option value="7">不按规定超车</option>
				        <option value="8">不按规定掉头</option>
				        <option value="9">开关车门</option>
				        <option value="10">无红绿灯路口未让右侧车辆先行</option>
				        <option value="11">右转车辆未让左转车辆先行</option>
				        <option value="12">进入环岛车辆未让环岛内车辆先行</option>
				        <option value="13">掉头车辆未让正常行驶车辆先行</option>
				        <option value="14">未按导向标识行驶</option>
				        <option value="15">违反让行标识的</option>
				        <option value="16">违反规定在专用车道内行驶</option>
				        <option value="17">违反装载规定超长、超宽的</option>
				        <option value="18">装载的货物在掉落、飘散中导致交通事故的</option>
				        <option value="19">碰撞正常停放三者车</option>
					</select> --%></td>
				</tr>
				<tr>
					<td align="right" width="20%" nowrap>
		                <label class="Validform_label_OR">  <t:mutiLang langKey="是否可疑"/>:  </label>
		            </td>
		            <td class="value" width="30%"><t:dictSelect id="ask"
							hasLabel="false" field="ask" typeGroupCode="ask"
							defaultVal="${surveyInfo.ask}" extendJson="{'onChange':'askChange();'}"></t:dictSelect>
					
		            </td>
		            
		            <td align="right" width="20%" nowrap>
						<label class="Validform_label_OR"> <t:mutiLang langKey="减损类型"/>: </label>
					</td>
					<td class="value" width="30%"><t:dictSelect id="askType"
							hasLabel="false" field="askType" typeGroupCode="askType"
							defaultVal="${surveyInfo.askType}"></t:dictSelect>
		            </td>
		            
				</tr>
				<tr>
					<td align="right" width="20%" nowrap>
		                <label class="Validform_label_OR">  <t:mutiLang langKey="减损备注"/>:  </label>
		            </td>
					<td class="value" colspan="3"  width="100%">
					<input id="askRrk"
						class="inputxt" style="width: 100%" name="askRrk"
						value="${surveyInfo.askRrk}">
		            </td>
				</tr>
				
				<tr>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="备注" />:
					</label></td>
					<td class="value" colspan="3" width="100%"><input id="remark"
						class="inputxt" style="width: 100%" name="remark"
						value="${surveyInfo.remark}"></td>
				</tr>
				<tr>
					<td align="right" width="20%" nowrap><label
						class="Validform_label_OR"> <t:mutiLang langKey="案件修改说明" />:
					</label></td>
					<td class="value" colspan="3" width="100%"><input
						class="inputxt" style="width: 100%"
						value="${surveyInfo.updateRemark}" disabled="disabled"> <input
						id="updateRemark" type="hidden" name="updateRemark"
						value="${surveyInfo.updateRemark}"></td>
				</tr>
			</table>

			<c:forEach items="${carInfoList}" var="carInfo" varStatus="varSta">

				<div style="color: red;">
					<strong>${carInfo.indexNme}信息</strong>
				</div>
				<input id="indexNme" class="inputxt"
					name="carInfoListForm[${varSta.index}].indexNme"
					value="${carInfo.indexNme}" type="hidden">
				<table cellpadding="0" cellspacing="1" class="formtable"
					style="width: 100%;">
					<tr>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="车牌号" />:
						</label></td>
						<td class="value" width="30%"><input id="carNo"
							class="inputxt" name="carInfoListForm[${varSta.index}].carNo"
							value="${carInfo.carNo}"></td>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="案件流水号" />:
						</label></td>
						<td class="value" width="30%">${carInfo.reportNo}<input
							type="hidden" name="carInfoListForm[${varSta.index}].reportNo"
							value="${carInfo.reportNo}">
						</td>
					</tr>
					<tr>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="驾驶员" />:
						</label></td>
						<td class="value" width="30%"><input id="driverNme"
							class="inputxt" name="carInfoListForm[${varSta.index}].driverNme"
							value="${carInfo.driverNme}"></td>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="联系电话" />:
						</label></td>
						<td class="value" width="30%"><input id="phone"
							class="inputxt" name="carInfoListForm[${varSta.index}].phone"
							value="${carInfo.phone}"></td>
					</tr>
					<tr>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="交强险承保公司" />:
						</label></td>
						<td class="value" width="30%"><input
							id="compulsoryCompany${varSta.index}" type="hidden"
							name="carInfoListForm[${varSta.index}].compulsoryCompany"
							value="${carInfo.compulsoryCompany}"> <input
							id="namecompulsoryCompany${varSta.index}" class="inputxt"
							value="${carInfo.comPanName}"
							onclick="openDepartmentSelect('compulsoryCompany${varSta.index}')">
						</td>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="商业险承保公司" />:
						</label></td>
						<td class="value" width="30%"><input
							id="businessCompany${varSta.index}" type="hidden"
							name="carInfoListForm[${varSta.index}].businessCompany"
							value="${carInfo.businessCompany}"> <input
							id="namebusinessCompany${varSta.index}" class="inputxt"
							value="${carInfo.busPanName}"
							onclick="openDepartmentSelect('businessCompany${varSta.index}')">
						</td>
					</tr>
					<tr>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="事故责任" />:
						</label></td>
						<td class="value" width="30%"><select
							id="accidentLiability${varSta.index}"
							name="carInfoListForm[${varSta.index}].accidentLiability"
							width="100" style="width: 104px"
							onchange="changeAccd('${varSta.index}')"
							value="${carInfo.accidentLiability}">
								<option value="全责">全责</option>
								<option value="主责">主责</option>
								<option value="同责">同责</option>
								<option value="次责">次责</option>
								<option value="无责">无责</option>
						</select></td>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="碰撞部位" />:
						</label></td>
						<td class="value" width="30%"><input
							id="siteType${varSta.index}"
							name="carInfoListForm[${varSta.index}].siteType" type="hidden"
							value="${carInfo.siteType}"> <input
							id="siteType${varSta.index}1" type="checkbox" value="左前部"
							onclick="checkOrNo('${varSta.index}1')">左前部 <input
							id="siteType${varSta.index}2" type="checkbox" value="正前部"
							onclick="checkOrNo('${varSta.index}2')">正前部 <input
							id="siteType${varSta.index}3" type="checkbox" value="右前部"
							onclick="checkOrNo('${varSta.index}3')">右前部 <input
							id="siteType${varSta.index}4" type="checkbox" value="左中部"
							onclick="checkOrNo('${varSta.index}4')">左中部 <input
							id="siteType${varSta.index}5" type="checkbox" value="右中部"
							onclick="checkOrNo('${varSta.index}5')">右中部 <input
							id="siteType${varSta.index}6" type="checkbox" value="左后部"
							onclick="checkOrNo('${varSta.index}6')">左后部 <input
							id="siteType${varSta.index}7" type="checkbox" value="正后部"
							onclick="checkOrNo('${varSta.index}7')">正后部 <input
							id="siteType${varSta.index}8" type="checkbox" value="右后部"
							onclick="checkOrNo('${varSta.index}8')">右后部</td>
					</tr>
					<tr>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="车辆种类" />:
						</label></td>
						<td class="value" width="30%"><select
							id="carType${varSta.index}"
							name="carInfoListForm[${varSta.index}].carType" width="100"
							style="width: 104px" value="${carInfo.carType}">
								<option value="营业货车">营业货车</option>
								<option value="家庭自用汽车">家庭自用汽车</option>
								<option value="非营业用客车">非营业用客车</option>
								<option value="营业客车">营业客车</option>
								<option value="非营业用货车">非营业用货车</option>
								<option value="摩托车">摩托车</option>
								<option value="特种车">特种车</option>
								<option value="单位行政用车">单位行政用车</option>
								<option value="其他">其他</option>
						</select></td>
						<td align="right" width="20%" nowrap><label
							class="Validform_label_OR"> <t:mutiLang langKey="快赔案件" />:
						</label></td>
						<td class="value" width="30%"><c:if
								test="${carInfo.indexNme == '甲方车辆'}">
								<select id="quickCase${varSta.index}"
									name="carInfoListForm[${varSta.index}].quickCase" width="100"
									style="width: 104px" onchange="showOrHide('${varSta.index}')"
									value="${carInfo.quickCase}">
									<option value="是">是</option>
									<option value="否">否</option>
								</select>
							</c:if></td>
					</tr>
					<c:if test="${carInfo.indexNme != '甲方车辆'}">
						<tr>
							<td align="right" width="20%" nowrap><label
								class="Validform_label_OR"> <t:mutiLang langKey="赔偿方式" />:
							</label></td>
							<td class="value" width="30%"><input
								id="cmethod${varSta.index}" type="hidden"
								name="carInfoListForm[${varSta.index}].cmethod"
								value="${carInfo.cmethod}"> <input
								name="cmethod${varSta.index}" type="radio" value="需保险理赔"
								onclick="changeRadio('${varSta.index}')">需保险理赔 <input
								name="cmethod${varSta.index}" type="radio" value="无需保险理赔"
								onclick="changeRadio('${varSta.index}')">无需保险理赔</td>
							<c:if test="${varSta.index<2 }">
								<td align="right" width="20%" nowrap id="mta1${varSta.index}">
									<label class="Validform_label_OR"> <t:mutiLang
											langKey="互碰自赔" />:
								</label>
								</td>
								<td class="value" width="30%" id="mta2${varSta.index}"><select
									id="mtasc${varSta.index}"
									name="carInfoListForm[${varSta.index}].mtasc" width="100"
									style="width: 104px" onchange="changeMacDir('${varSta.index}')"
									value="${carInfo.mtasc}">
										<option value="否">否</option>
										<option value="是">是</option>
								</select> <%-- <input id="mtasc" class="inputxt" name="carInfoListForm[${varSta.index}].mtasc" value="${carInfo.mtasc}" > --%>
								</td>
							</c:if>
							<c:if test="${varSta.index>=2 }">
								<td align="right" width="20%"></td>
								<td class="value" width="30%"></td>
							</c:if>
						</tr>
						<tr id="dir1${varSta.index}">
							<td align="right" width="20%" nowrap><label
								class="Validform_label_OR"> <t:mutiLang langKey="无责直赔" />:
							</label></td>
							<td class="value" width="30%"><select
								id="directc${varSta.index}"
								name="carInfoListForm[${varSta.index}].directc" width="100"
								style="width: 104px" onchange="changeMacDir('${varSta.index}')"
								value="${carInfo.directc}">
									<option value="否">否</option>
									<option value="是">是</option>
							</select> <%-- <input id="directc" class="inputxt" name="carInfoListForm[${varSta.index}].directc" value="${carInfo.directc}" > --%>
							</td>
							<td></td>
							<td></td>
						</tr>
					</c:if>

					<tr id="show${varSta.index}">
						<td align="left" colspan="4" nowrap>
							<table style="width: 100%;" class="formtable">
								<tr>
									<td align="left" colspan="4" nowrap><strong
										style="color: blue; padding-left: 5%;">直赔信息</strong></td>
								</tr>
								<tr>
									<td align="right" width="20%" nowrap><label
										class="Validform_label_OR"> <t:mutiLang langKey="被保险人" />:
									</label></td>
									<td class="value" width="30%"><input id="insuredPerson"
										class="inputxt"
										name="carInfoListForm[${varSta.index}].insuredPerson"
										value="${carInfo.insuredPerson}"></td>
									<td align="right" width="20%" nowrap><label
										class="Validform_label_OR"> <t:mutiLang langKey="领款人" />:
									</label></td>
									<td class="value" width="30%"><c:if
											test="${carInfo.indexNme != '甲方车辆'}">
											<input id="payeePerson" class="inputxt"
												name="carInfoListForm[${varSta.index}].payeePerson"
												value="${carInfo.payeePerson}">
										</c:if></td>
								</tr>
								<tr>
									<td align="right" width="20%" nowrap><label
										class="Validform_label_OR"> <t:mutiLang langKey="开户行" />:
									</label></td>
									<td class="value" width="30%"><input id="bankNme"
										class="inputxt"
										name="carInfoListForm[${varSta.index}].bankNme"
										value="${carInfo.bankNme}"></td>
									<td align="right" width="20%" nowrap><label
										class="Validform_label_OR"> <t:mutiLang langKey="卡号" />:
									</label></td>
									<td class="value" width="30%"><input id="bankNo"
										class="inputxt" name="carInfoListForm[${varSta.index}].bankNo"
										value="${carInfo.bankNo}"></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>


				<script>
					//checkBox默认选中
					$(function() {
						$("#accidentLiability${varSta.index}").val(
								"${carInfo.accidentLiability}");
						$("#carType${varSta.index}").val("${carInfo.carType}");
						$("#quickCase${varSta.index}").val(
								"${carInfo.quickCase}");
						$("#directc${varSta.index}").val("${carInfo.directc}");
						$("#mtasc${varSta.index}").val("${carInfo.mtasc}");
						$("input[name='cmethod${varSta.index}'][value='${carInfo.cmethod}']")
								.attr("checked", true);

						if ("是" != $("#quickCase${varSta.index}").val()) {
							$("#show${varSta.index}").hide();

						} else {
							$("#show${varSta.index}").show();
						}

						var cmethod = $(
								"input[name='cmethod${varSta.index}']:checked")
								.val();
						if ("需保险理赔" == cmethod) {
							$("#mta1${varSta.index}").show();
							$("#mta2${varSta.index}").show();
							$("#dir1${varSta.index}").show();
							$("#show${varSta.index}").show();
						} else if ("无需保险理赔" == cmethod) {
							$("#mtasc${varSta.index}").val("");
							$("#directc${varSta.index}").val("");
							$("#mta1${varSta.index}").hide();
							$("#mta2${varSta.index}").hide();
							$("#dir1${varSta.index}").hide();
							$("#show${varSta.index}").hide();
						}

						var siTypeStr = $("#siteType${varSta.index}").val()
								.split(",");
						for (var i = 1; i <= 8; i++) {
							for (var j = 0; j < siTypeStr.length; j++) {
								if (siTypeStr[j] == $(
										"#siteType${varSta.index}" + i).val()) {
									$("#siteType${varSta.index}" + i).attr(
											"checked", true);
								}
							}
						}
					});

					//互碰自配和无责直赔切换
					function changeMacDir(num) {
						var directc = $("#directc" + num).val();
						var mtasc = $("#mtasc" + num).val();
						if ("是" == directc) {
							$("#mtasc" + num).val("否");
						} else if ("是" == mtasc) {
							$("#directc" + num).val("否");
						}
					}

					//甲方车辆直赔信息显示隐藏
					function showOrHide(num) {
						if ("0" == num) {
							if ("是" != $("#quickCase" + num).val()) {
								$("#show" + num).hide();
							} else {
								$("#show" + num).show();
								$("#show0 input").each(function() {
									$(this).val("");
								});
							}
						}
					}

					//重写remove方法
					Array.prototype.remove = function(obj) {
						for (var i = 0; i < this.length; i++) {
							var temp = this[i];
							if (!isNaN(obj)) {
								temp = i;
							}
							if (temp == obj) {
								for (var j = i; j < this.length; j++) {
									this[j] = this[j + 1];
								}
								this.length = this.length - 1;
							}
						}
					};

					//更改radio值
					function changeRadio(num) {
						var cmethod = $(
								"input[name='cmethod" + num + "']:checked")
								.val();
						$("#cmethod" + num).val(cmethod);
						if ("需保险理赔" == cmethod) {
							$("#mta1" + num).show();
							$("#mta2" + num).show();
							$("#dir1" + num).show();
							$("#show" + num).show();
						} else {

							$("#mtasc" + num).val("");
							$("#directc" + num).val("");

							$("#mta1" + num).hide();
							$("#mta2" + num).hide();
							$("#dir1" + num).hide();
							$("#show" + num).hide();

							$("#show1 input").each(function() {
								$(this).val("");
							});
						}
					}

					//更改checkBox时执行
					function checkOrNo(num) {
						var step = num.substring(0, 1);
						var siTypeStr = $("#siteType" + step).val().split(",");
						var siteT = $("#siteType" + num).val();

						if ($("#siteType" + num).is(':checked')) {
							siTypeStr.push(siteT);
						} else {
							siTypeStr.remove(siteT);
						}
						$("#siteType" + step).val(siTypeStr.toString());
					}
				</script>
			</c:forEach>
		</div>
	</t:formvalid>
	</div>
</body>